package com.jxy.homepage.web.api;

import com.jxy.BBM_info.BBM;
import com.jxy.homepage.service.TreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TreeController
 *
 * @author Jxy
 * @date 2022/4/21
 * @Description TODO
 */
@RestController
@RequestMapping("/api")
public class TreeController {

    private final TreeService treeService;

    @Autowired
    public TreeController(TreeService treeService) {
        this.treeService = treeService;
    }

    @RequestMapping("doTree")
    public BBM doTree(@RequestBody BBM request){
        BBM bbm = null;
        try {
            bbm = treeService.doTree(request);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bbm;
    }
    @RequestMapping("queryTree")
    public BBM queryTree(@RequestBody BBM request){
        BBM bbm = null;
        try {
            bbm = treeService.queryTree(request);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bbm;
    }
}
